package main

import (
	"fmt"
	"sync"
)

var wg sync.WaitGroup

func main() {
	//runtime.GOMAXPROCS(8)
	wg.Add(2)
	go a()
	go b()

	wg.Wait()

}

func hello(i int) {
	defer wg.Done()
	defer fmt.Println("张三傻逼", i)
}

func a() {
	defer wg.Done()

	for i := 1; i <= 100; i++ {
		fmt.Println("A:", i)
	}
}

func b() {
	defer wg.Done()
	for i := 1; i <= 100; i++ {
		fmt.Println("B:", i)
	}
}
